package com.kantboot.business.water.web.contrller;

import com.kantboot.business.water.domain.dto.BusWaterGoodsDTOInClient;
import com.kantboot.business.water.domain.entity.BusWaterGoods;
import com.kantboot.business.water.service.IBusWaterGoodsService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品
 */
@RestController
@RequestMapping("/bus/water/goods")
public class BusWaterGoodsController {

    @Resource
    private IBusWaterGoodsService service;

    @RequestMapping("/getBodyDataClient")
    public RestResult<PageResult> getBodyDataClient(
            @RequestBody PageParam<BusWaterGoodsDTOInClient> pageParam){
        return RestResult.success(service.getBodyDataClient(pageParam),"getSuccess","获取成功");
    }

    @RequestMapping("/getById")
    public RestResult<BusWaterGoods> getById(@RequestParam("id") Long id){
        return RestResult.success(service.getById(id),"getSuccess","获取成功");
    }


}
